package com.cq.system.feign;

import com.cq.feignapi.clients.UserClients;
import com.cq.feignapi.entity.TB_User;
import com.cq.system.service.UserService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userClient")
public class UserClientController implements UserClients {
    @Autowired
    UserService userService;
    @Override
    @RequestMapping("/getUserById")
    public TB_User getUser() {
        System.out.println("实现接口");
        com.cq.system.entity.TB_User user = userService.getById("2");
        TB_User returnUser = new TB_User();
        BeanUtils.copyProperties(user,returnUser);
        return returnUser;
    }
}